import type * as T from './type'
import http from '@/utils/http'
import type { LabelValueState } from '@/types/global'
const BASE_URL = '/system/order'
/** @desc 查询列表 */
export function enterprisePage(query: T.OrderQuery) {
  return http.get<PageRes<T.OrderPageQuery[]>>(`${BASE_URL}/enterprisePage`, query)
}

export function getStaticsData(query: T.OrderQuery) {
  return http.get<T.OrderDto>(`${BASE_URL}/staticsData`,query)
}

export function getEnterpriseSt(query: T.OrderQuery) {
  return http.get<T.OrderDto>(`${BASE_URL}/enterpriseSt`,query)
}


export function channelPage(query: T.OrderQuery) {
  return http.get<PageRes<T.OrderPageQuery[]>>(`${BASE_URL}/channelPage`, query)
}

export function orderPage(query: T.OrderQuery) {
  return http.get<PageRes<T.OrderPageQuery[]>>(`${BASE_URL}/page`, query)
}



export function lists() {
  return http.get<T.OrderDto[]>(`${BASE_URL}/list`)
}

export function OrderSelect() {
  return http.get<LabelValueState[]>(`${BASE_URL}/getSelectList`)
}

/** @desc 查询详情 */
export function getOrder(id: string) {
  return http.get<T.OrderDto>(`${BASE_URL}/getData/${id}`)
}


/** @desc 退款 */
export function refund(data: any) {
  return http.get(`${BASE_URL}/refund`, data)
}


/** @desc 新增 */
export function addObject(data: any) {
  return http.post(`${BASE_URL}/create`, data)
}


/** @desc 修改状态 */
export function updateChannelSettle(data: any) {
  return http.post(`${BASE_URL}/updateChannelSettle`, data)
}

/** @desc 修改状态 */
export function updateEnterpriseSettle(data: any) {
  return http.post(`${BASE_URL}/updateEnterpriseSettle`, data)
}


/** @desc 修改 */
export function updateObject(data: any) {
  return http.post(`${BASE_URL}/modify`, data)
}

/** @desc 删除 */
export function deleteObject(ids: string | Array<string>) {
  return http.del(`${BASE_URL}/delete/${ids}`)
}


/** @desc 刷新緩存 */
export function refreshCache() {
  return http.get(`${BASE_URL}/refreshCache`)
}


/** @desc 下载导入模板 */
export function downloadUserImportTemplate() {
  return http.download(`${BASE_URL}/importTemplate`)
}


/** @desc 解析导入数据 */
export function importParse(data: any) {
  return http.post(`${BASE_URL}/importParse`, data)
}


/** @desc 导入 */
export function importOrder(data: any) {
  return http.post(`${BASE_URL}/import`, data)
}


/** @desc 下载渠道结算 */
export function downloadChannelSettle(data: any) {
  return http.download(`${BASE_URL}/exportChannelSettle`,data)
}



/** @desc 下载商家结算 */
export function exportEnterpriseSettle(data: any) {
  return http.download(`${BASE_URL}/exportEnterpriseSettle`,data)
}

/** @desc */
export function exportOrderExport(data: any) {
  return http.download(`${BASE_URL}/exportOrderExport`,data)
}

